package sim;

public class Customer extends SortableQueueItem{

	private long arrivalTime;
	private long serviceInitiationTime;
	private long serviceCompletionTime;
	
	public Customer(long arrivalTime) {
		this.arrivalTime = arrivalTime;
	}
	
	public long getArrivalTime(){
		return arrivalTime;
	}
	
	public long getServiceInitiationTime() {
		return serviceInitiationTime;
	}
	
	public long getServiceCompletionTime() {
		return serviceCompletionTime;
	}
	
	public void setInitiationTime(long time){
		serviceInitiationTime = time;
	}
	
	public void setCompletionTime(long time){
		serviceCompletionTime = time;
	}
	
	@Override
	public int compareTo(SortableQueueItem c) {
		if (c instanceof Customer) {
			Customer e = (Customer) c;
			if(equals(c)) return 0;
			if(arrivalTime < e.arrivalTime) return -1;
			if(arrivalTime > e.arrivalTime) return 1;
		}
		return 1;
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "Arrival: " + arrivalTime + " | Initialization: " + serviceInitiationTime + " | Completion: " + serviceCompletionTime ;
	}

}
